/*
 * Copyright (c) 2008-2024, Hazelcast, Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package usercodedeployment;

import com.hazelcast.map.EntryProcessor;
import java.util.Map;

/** contains class `EntryProcessorWithAnonymousAndInner`, to exercise loading classes with anonymous and named inner classes */
public class EntryProcessorWithAnonymousAndInner<K> implements EntryProcessor<K, Integer, Integer> {
    private static final long serialVersionUID = 8936595533044945435L;

    public EntryProcessorWithAnonymousAndInner() {
    }

    public Integer process(Map.Entry<K, Integer> var1) {
        Integer var2 = (Integer)var1.getValue();
        Integer var3 = var2 + 1;
        Test var4 = new Test(var1);
        Runnable var5 = () -> {
            var4.set(var3);
        };
        var5.run();
        return var3;
    }

    public class Test<K> {
        private final Map.Entry<K, Integer> entry;

        Test(Map.Entry<K, Integer> var2) {
            this.entry = var2;
        }

        void set(Integer var1) {
            this.entry.setValue(var1);
        }
    }
}
